<?php

/**
 * Menashop
 *
 * LICENSE
 *
 * This source file is subject to the license that is bundled
 * with this project in the file LICENSE.txt
 *
 * @category   Zend
 * @package    Admin_Model
 * @subpackage UserMapper
 * @copyright  Copyright (c) 2011 Menashop UA Inc. (http://www.menashop.com.ua)
 * @license    LICENSE.txt
 * @version    1.0.0
 * @since      File available since Release 1.0.0
 */

/**
 * The data model for user
 * 
 * @category   Zend
 * @package    Admin_Model
 * @subpackage User
 * @copyright  Copyright (c) 2011 Menashop UA Inc. (http://www.menashop.com.ua)
 * @license    LICENSE.txt
 */
class Admin_Model_User extends Zend_Db_Table_Abstract
{

    /**
     * The name of table
     * @var string 
     */
    protected $__name = 'user';

    /**
     * Find role of user by email
     * @param string $email
     * @return string
     */
    public function findRoleByEmail($email)
    {
        $query = $this->getAdapter()->select();
        $query->from($this->__name, 'role');
        $query->where('email = ?', $email);
        $result = $this->getAdapter()->fetchOne($query);
        return $result;
    }

}

